package com.ly.heart.service.impl;

import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ly.common.utils.DateUtils;
import org.springframework.stereotype.Service;
import com.ly.heart.mapper.SaleAndQuotationMapper;
import com.ly.heart.domain.SaleAndQuotationEntity;
import javax.annotation.Resource;
import com.ly.heart.service.ISaleAndQuotationService;

/**
 * 销售报价单与销售订单关联关系Service业务层处理
 * 
 * @author wutao
 * @date 2024-07-09
 */
@Service
public class SaleAndQuotationServiceImpl extends ServiceImpl<SaleAndQuotationMapper, SaleAndQuotationEntity> implements ISaleAndQuotationService {

    @Resource
    private SaleAndQuotationMapper saleAndQuotationMapper;

    /**
     * 查询销售报价单与销售订单关联关系
     * 
     * @param id 销售报价单与销售订单关联关系ID
     * @return 销售报价单与销售订单关联关系
     */
    @Override
    public SaleAndQuotationEntity selectSaleAndQuotationById(String id)
    {
        return saleAndQuotationMapper.selectSaleAndQuotationById(id);
    }

    /**
     * 查询销售报价单与销售订单关联关系列表
     * 
     * @param saleAndQuotation 销售报价单与销售订单关联关系
     * @return 销售报价单与销售订单关联关系
     */
    @Override
    public List<SaleAndQuotationEntity> selectSaleAndQuotationList(SaleAndQuotationEntity saleAndQuotation)
    {
        return saleAndQuotationMapper.selectSaleAndQuotationList(saleAndQuotation);
    }

    /**
     * 新增销售报价单与销售订单关联关系
     * 
     * @param saleAndQuotation 销售报价单与销售订单关联关系
     * @return 结果
     */
    @Override
    public int insertSaleAndQuotation(SaleAndQuotationEntity saleAndQuotation)
    {
        saleAndQuotation.setCreateTime(DateUtils.getNowDate());
        return saleAndQuotationMapper.insertSaleAndQuotation(saleAndQuotation);
    }

    /**
     * 修改销售报价单与销售订单关联关系
     * 
     * @param saleAndQuotation 销售报价单与销售订单关联关系
     * @return 结果
     */
    @Override
    public int updateSaleAndQuotation(SaleAndQuotationEntity saleAndQuotation)
    {
        saleAndQuotation.setUpdateTime(DateUtils.getNowDate());
        return saleAndQuotationMapper.updateSaleAndQuotation(saleAndQuotation);
    }

    /**
     * 批量删除销售报价单与销售订单关联关系
     * 
     * @param ids 需要删除的销售报价单与销售订单关联关系ID
     * @return 结果
     */
    @Override
    public int deleteSaleAndQuotationByIds(String[] ids)
    {
        return saleAndQuotationMapper.deleteSaleAndQuotationByIds(ids);
    }

    /**
     * 删除销售报价单与销售订单关联关系信息
     * 
     * @param id 销售报价单与销售订单关联关系ID
     * @return 结果
     */
    @Override
    public int deleteSaleAndQuotationById(String id)
    {
        return saleAndQuotationMapper.deleteSaleAndQuotationById(id);
    }
}
